package task6_5;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/4 9:35
 * @description:
 */
public class task6_5 {

  public static void main(String[] args) {
    BufferedReader br=null;
    BufferedWriter bw=null;
    try {
       br=new BufferedReader(new FileReader("a.txt"));
       bw=new BufferedWriter(new FileWriter("c:\\a.txt"));
      String line=null;
      while ((line=br.readLine())!=null){
        bw.write(line);
        bw.newLine();
      }
    } catch (Exception e) {
      System.out.println(e.getMessage());
    }
    finally {
      if (br!=null){
        try {
          br.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
      if (bw!=null){
        try {
          bw.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }

  }

}
